#include "PDTFunction.h"

PDTFunctionDec::PDTFunctionDec(PDTCodeGraph &CG,string &name,PDTListOfStatements & body,PDTVar & returnVar,vector<PDTVar*> &arguments):PDTNode(CG)
{
	this->name=name;

	int size=arguments.size();
	for (int i=0 ; i<size; i++ )
	{
		addWriter((arguments[i])->getNode());
		writers[i]->addReader(this);
		addChild(writers[i]);
		writers[i]->addParent(this);
	}


	addReader(returnVar.getNode());
	readers[0]->addWriter(this);

	addChild(&body);
	addChild(readers[0]);
	(&body)->addParent(this);
	readers[0]->addParent(this);

}
